package net.wanho.dao;

import net.wanho.entity.Course;
import net.wanho.entity.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentDaoI {
    @Select(" select * from student ")
    List<Student> selectAllStudents();

    @Select(" select * from student where sname like '%${sname}%' and datediff(inDate,'2008-09-01')>0")
    List<Student> selectStudent(String sname);

    @Insert(" insert into student values(#{sid},#{sname},#{ssex},#{sbirthday},#{inDate},#{deleteFlag}) ")
    void insertStudent(Student student);

    @Delete(" delete from student where sid=#{sid} ")
    void deleteStudent(String sid);

    @Update(" update student set sname=#{sname},ssex=#{ssex}," +
            "sbirthday=#{sbirthday},inDate=#{inDate},deleteFlag=#{deleteFlag} " +
            "where sid=#{sid} ")
    void updateStudent(Student student);
    List<Course> selectCourseTeacher();
}
